package com.bawei.mvvm.viewmodel

import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import com.bawei.mvvm.entity.User
import com.bawei.mvvm.http.ApiResponse
import com.bawei.mvvm.http.ApiService
import com.bawei.mvvm.http.RetrofitManager
import com.bawei.mvvm.respository.LoginRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import okhttp3.RequestBody
import javax.inject.Inject
//hilt专门为viewmodel提供的
@HiltViewModel
class LoginViewModel @Inject constructor(var loginRepository: LoginRepository):ViewModel() {
//    @Inject
//    lateinit var loginRepository: LoginRepository
    fun login(requestBody: RequestBody): LiveData<ApiResponse<User>> {
        return loginRepository.login(requestBody)
    }
}